destring state_county_fips, generate(fips)

replace daily_change_deaths_per100k = . if daily_change_deaths_per100k < 0
replace daily_change_cases_per100k = . if daily_change_cases_per100k < 0

replace lagged_daily_change_deaths_per10 = . if lagged_daily_change_deaths_per10 < 0
replace lagged_daily_change_cases_per100 = . if lagged_daily_change_cases_per100 < 0

* Deaths

reghdfe deaths_per_100k prcntBlack prcntHisp prcntAsian prcntMulti prcntWhite prcntForeignBorn,absorb(date) vce(cluster date fips)

reghdfe deaths_per_100k lagged_deaths_per_100k prcntBlack prcntHisp prcntAsian prcntMulti prcntWhite prcntForeignBorn,absorb(date) vce(cluster date fips)

reghdfe deaths_per_100k lagged_deaths_per_100k prcntBlack prcntHisp prcntAsian prcntMulti prcntWhite prcntForeignBorn medianAge medianIncome prcntBA prcntOld pop_sq_mi totalPopulation,absorb(date) vce(cluster date fips)

* Deaths Daily Trend

reghdfe daily_change_deaths_per100k prcntBlack prcntHisp prcntAsian prcntMulti prcntWhite prcntForeignBorn,absorb(date) vce(cluster date fips)

reghdfe daily_change_deaths_per100k lagged_daily_change_deaths_per10 prcntBlack prcntHisp prcntAsian prcntMulti prcntWhite prcntForeignBorn,absorb(date) vce(cluster date fips)

reghdfe daily_change_deaths_per100k lagged_daily_change_deaths_per10 prcntBlack prcntHisp prcntAsian prcntMulti prcntWhite prcntForeignBorn medianAge medianIncome prcntBA prcntOld pop_sq_mi totalPopulation,absorb(date) vce(cluster date fips)

* Cases

reghdfe daily_change_cases_per100k lagged_daily_change_cases_per100 prcntWhite prcntHisp prcntBlack prcntAsian prcntMulti prcntForeignBorn medianAge medianIncome prcntBA prcntOld pop_sq_mi totalPopulation,absorb(date) vce(cluster date fips)

reghdfe cases_per_100k lagged_cases_per_100k prcntWhite prcntHisp prcntBlack prcntAsian prcntMulti prcntForeignBorn medianAge medianIncome prcntBA prcntOld pop_sq_mi totalPopulation,absorb(date) vce(cluster date fips)



reghdfe deaths_per_100k lagged_deaths_per_100k prcntWhite prcntHisp prcntBlack prcntAsian prcntMulti prcntForeignBorn medianAge medianIncome prcntBA prcntOld pop_sq_mi totalPopulation,absorb(date) vce(cluster date fips)



xtset fips date

xtreg daily_change_deaths_per100k lagged_daily_change_deaths_per10 prcntWhite prcntHisp prcntBlack prcntAsian prcntMulti prcntForeignBorn medianAge medianIncome prcntBA prcntOld pop_sq_mi totalPopulation,re vce(cluster fips)

xtreg deaths_per_100k lagged_deaths_per_100k prcntWhite prcntHisp prcntBlack prcntAsian prcntMulti prcntForeignBorn medianAge medianIncome prcntBA prcntOld pop_sq_mi totalPopulation,re vce(cluster fips)

